package com.sinoyd.itszyw.Dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.StyleRes;
import android.view.LayoutInflater;
import android.view.View;

import com.sinoyd.itszyw.R;
import com.wang.avi.AVLoadingIndicatorView;

/**
 * @createBy : Sinoyd 大饼洲
 * @description :
 * @projectName : ITYW
 * @creationDate: 2017-03-29 14:47
 */
public class LoadingDialog extends Dialog {

    private LayoutInflater mLayoutInflater;
    private AVLoadingIndicatorView avi;

    public LoadingDialog(Context context) {
        super(context);
        mLayoutInflater = LayoutInflater.from(context);
    }


    public LoadingDialog(Context context, @StyleRes int themeResId) {
        super(context, themeResId);
        mLayoutInflater = LayoutInflater.from(context);

    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_loading);
        setCancelable(false);
        avi= (AVLoadingIndicatorView) findViewById(R.id.indicator);
        avi.show();
    }
    public void hideClick(View view) {
        avi.hide();
        // or avi.smoothToHide();
    }

    public void showClick(View view) {
        avi.show();
        // or avi.smoothToShow();
    }
}
